/*
 * @Author: lineCode 1145938682@qq.com
 * @Date: 2024-12-27 13:38:19
 * @LastEditors: lineCode 1145938682@qq.com
 * @LastEditTime: 2025-03-16 19:31:32
 * @FilePath: /backend/shorthand-modules/shorthand-modules-content/src/main/java/com/angus/modules/content/controller/work/SysOrderController.java
 */
package com.angus.modules.content.controller.work;


import com.angus.common.core.web.controller.BaseController;
import com.angus.common.core.web.domain.AjaxResult;
import com.angus.common.security.utils.SecurityUtils;
import com.angus.modules.content.dto.MyFeedBackDto;
import com.angus.modules.content.service.IMyFeedBackService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/feedBack")
public class MyFeedBackController extends BaseController {

    @Resource
    private IMyFeedBackService feedBackService;

    @GetMapping("/getList")
    public AjaxResult getList(@RequestParam(value = "status", required = false, defaultValue = "0") Integer status,
                                   @RequestParam(value = "feedType",required = false,defaultValue = "") String feedType) {
        Long userId = SecurityUtils.getUserId();
        MyFeedBackDto dto = new MyFeedBackDto();
        dto.setStatus(status);
        dto.setFeedType(feedType);
        return AjaxResult.success(feedBackService.query(dto,userId));
    }


    @PostMapping("/add")
    public AjaxResult createOrder(@RequestBody MyFeedBackDto dto){
        Long userId = SecurityUtils.getUserId();
        return AjaxResult.success(feedBackService.add(dto, userId));
    }

    @GetMapping("/getDetail")
    public AjaxResult getOrderDetail(@RequestParam(value = "id") Long id){
        return AjaxResult.success(feedBackService.getById(id));
    }

}
